package graphicsExtended.animation.animationSequence;

import java.awt.Image;
import java.awt.Point;
import tuples.Pair;

/**
 *
 * @author Shimu
 * @date 6-Oct-2012
 */
public interface AnimationSequence {
    
    /**
     * A status indicating this AnimationSequence has the next frame
     * ready, and hence calling getNextFrame() will return a valid 
     * frame to the Animation.
     */
    public static final int STATUS_FRAME_READY = 1;
    
    /**
     * Skip the current frame.
     */
    public static final int STATUS_SKIP_FRAME = 2;
    
    /**
     * A status indicating this AnimationSequence has frames left, but the
     * next frame is not ready yet. Hence getNextFrame() may not return a valid
     * frame to the Animation. This status promises that at a later, finite
     * time in the future, this AnimationSequence will have a status of 
     * STATUS_FRAME_READY.
     
    public static final int STATUS_FRAME_NOT_READY = 3;*/
    
    /**
     * A status indicating this AnimationSequence has no more frames left.
     */
    public static final int STATUS_NO_MORE_FRAMES = 4;
        
    /**
     * Returns the current status of this AnimationSequence. One of:
     * STATUS_FRAME_READY, STATUS_FRAME_NOT_READY, or
     * STATUS_NO_MORE_FRAMES.
     * @return 
     */
    public int getStatus();
        
    /**
     * Returns the next frame in this AnimationSequence. This method is only
     * required to return a valid frame to the AnimationSequence when
     * getStatus() returns STATUS_FRAME_READY. Its behavior when status
     * is not STATUS_FRAME_READY is unspecified (it may loop forever,
     * crash, or return an invalid frame).
     * @return 
     */
    public Pair<Image, Point> getNextFrame();
}
